package pl.enigmatic.parser.string.pl.edu.enigma.math.perm;

import pl.enigmatic.math.perm.Permutation;
import pl.enigmatic.parser.string.Converter;
import pl.enigmatic.parser.string.PrimitiveArrayConverter;


public class PermutationConverter extends Converter<Permutation> {

	private final PrimitiveArrayConverter array = new PrimitiveArrayConverter(int[].class);

	@Override
	public Permutation convert(String value) {
		return new Permutation((int[]) array.convert(value));
	}

	@Override
	public String convertBack(Permutation value) {
		return array.convertBack(value.array());
	}

}
